<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2017/2/13
 * Time: 14:21
 */

namespace common\modules;

use  Yii;
/**
 * 统一定义引导module,在module-config.php模块配置文件中指定,如：'home' => 'lib\modules\BaseModule'
 * 若在home模块下需做覆盖等特殊处理，可创建子Module文件并继承lib\modules\BaseModule
 * Author: itan.M
 * Class BaseModule
 * @property string $themePath
 * @package lib\modules
 */
class CommonModule extends \yii\base\Module{

    public $layout = 'main';

    public function init()
    {
        parent::init();
        $this->controllerNamespace = 'modules\\'. $this->id .'\controllers';
        //视图路径
        $this->viewPath = '@themes/views/' . $this->id;
        //配置布局文件路径
        $this->layoutPath = '@themes/layouts';
        //assets资源包
        $themes = Yii::getAlias('@themes');
        Yii::setAlias('assets', $themes . '/assets');
        Yii::setAlias('resources', $themes .'/resources');
    }

}